<!DOCTYPE html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <script src="./js/vue.js"></script>
</head>

<body>
    <div id="app">
        这个游戏机的价格是：{{price}},含税价格：{{price1}},折合人民币价格{{price2}} 

        <button @click="btnclick(1000)">加价1000</button>
    </div>

    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                price:29980,
                price1:0,
                price2:0,
            },
            methods: {
                btnclick(newpri){
                    this.price += newpri;
                }
            },
            watch:{
                // watch:{
                    // 被监听的数据(newval,oldval)
                    // 相关代码逻辑
                // }
                price(newval,oldval){
                    this.price1 = this.price*1.08
                    this.price2 = this.price1/16.75
                }
            }
        })
    </script>
</body>

</html>